<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script>
  // function f(a) {
  //   a++;
  //   console.log(a);
  // }
  // var x = 10;
  // f(x);  // => 11
  // console.log(x);  // => 10

  function Person(name) {
    this.name = name;
  }
  function f(x) {
    console.log(x.name);
    x.name = '张学友';
    console.log(x.name);
  }
  var a = new Person('刘德华');
  console.log(a.name);
  f(a);
  console.log(a.name);
</script>
</html>